#ifndef FRACALCDATA_H
#define FRACALCDATA_H

#include <QPixmap>
#include <QVector>

#include "FrakOutDataItem.h"

class QDataStream;

class FrakOutData
{

public:
    explicit FrakOutData();
    explicit FrakOutData(const QPixmap& image);
    explicit FrakOutData(const QPixmap& image, const QVector<FrakOutDataItem>& items, double cellScaleFactor);
    void addCell(int pos, const QPair<int,int>& cell);
    void addItem(const FrakOutDataItem& item);
    void addItem(int pos, const FrakOutDataItem& item);
    bool cellExists(int pos, const QPair<int,int>& cell) const;
    double cellScaleFactor() const;
    void clearSheets();
    const QPixmap& image() const;
    double initialCellSize() const;
    const QVector<FrakOutDataItem>& items() const;
    int numItems() const;
    void removeCell(int pos, const QPair<int,int>& cell);
    void removeCells(int pos);
    void removeItem(int i);
    void setCells(int pos, const QSet<QPair<int,int> >& cells);
    void setCellScaleFactor(double cellScalefactor);
    void init(const QString& filename);

signals:

public slots:

private:

    double m_cellScaleFactor;

    /** The image on which the fractal dimension is calculated. */
    QPixmap m_image;

    QVector<FrakOutDataItem> m_items;
};

/** Output operator. */
QDataStream& operator<<(QDataStream& out, const FrakOutData& fracalcData);

/** Input operator. */
QDataStream& operator>>(QDataStream &in, FrakOutData& fracalcData);

#endif // FRACALCDATA_H
